package com.yonyou.pmclouds.outter.tenantsdk.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.outter.tenantsdk.entity.TenantSdkUserInfo;
import com.yonyou.pmclouds.user.entity.UserInfo;
import com.yonyou.pmclouds.user.entity.UserSearchResultVO;
import com.yonyou.pmclouds.user.entity.UserSingleQueryVO;

import java.util.List;

/**
 * @Description: iuap-tenant-sdk 信息服务类
 * @Author: zhangzhonghao
 * @Date: 2020-04-16
 */
public interface IUserInfoService {

    /**
     * 批量添加用户，如果存在的用户直接添加关联关系
     * @param userInfoArray 用户信息
     * @return 成功后返回的用户信息
     */
    TenantSdkUserInfo[] addUsersAndRelations(TenantSdkUserInfo[] userInfoArray) throws BusinessException;

    /**
     * 应用下移除用户
     * @param userIds 用户Id数组
     */
    void removeUsersFromApps(String[] userIds) throws BusinessException;

    TenantSdkUserInfo[] addUsers(TenantSdkUserInfo[] userInfoArray) throws BusinessException;

    UserSearchResultVO.ContentVO searchUsers(String tenantid, String keyword, int pageNum,
                                             int pageSize);

    List<UserSingleQueryVO> isUsersExist(UserInfo[] userInfos);

    List<UserInfo> batchCreateUsers(UserInfo[] userInfos);
}
